﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Net;

namespace Notifying
{
    public class Emailer
    {
        string _smtpServer;

        public Emailer(string SmtpServer)
        {
            _smtpServer = SmtpServer;
        }

        public void SendEmail(string Text, string EmailAddress)
        {
            MailMessage Mail = new MailMessage("Knowfirst@Gmail.com", EmailAddress,
                "Latest Update From KnowFirst", Text);
            Mail.IsBodyHtml = true;

            SmtpClient SmtpClient = new SmtpClient("smtp.gmail.com");
            NetworkCredential basicCredential = new NetworkCredential("roeyaus@gmail.com", "X-Port246");
            SmtpClient.Credentials = basicCredential;
            SmtpClient.Port = 587;
            SmtpClient.EnableSsl = true;
            SmtpClient.Send(Mail);

            
        }
    }
}
